package com.cy.pj.goods.service;

import com.cy.pj.goods.dao.GoodsDao;
import com.cy.pj.goods.pojo.Goods;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import java.sql.SQLException;
import java.util.List;

@Service
public class GoodsServiceImpl implements GoodsService{

    private final  Logger log= LoggerFactory.getLogger(GoodsServiceImpl.class);
    @Autowired
    GoodsDao goodsDao;

    @Override
    public void timeService() throws SQLException {
        long sartTime=System.nanoTime();
        List<Goods> goodsList=goodsDao.findGoods();
        long endTime=System.nanoTime();
        log.info("time",(endTime-sartTime));
        System.out.println(endTime-sartTime);
    }

}
